<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>PowerVR SDK</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<table width="100%">
  <tr>
    <td width="33%">
      <p align="left">&nbsp;<a href="http://www.imgtec.com"><img border="0" src="IMGLogo.jpg" width="200" height="30"></a></p>
    </td>
    <td width="33%">
      <p align="center"><font color="#808080" face="Arial" size="2">PowerVR Software Development Kit</a></font></p>
    </td>
    <td width="34%">
      <p align="right"><a href="http://www.powervr.com"><img border="0" src="PVRlogo.jpg" width="200" height="27"></a></p>
    </td>
  </tr>
</table>
<hr>
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
<h1>BoundingBox.h</h1><a href="BoundingBox_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/******************************************************************************</span>
00002 <span class="comment"></span>
00003 <span class="comment"> @File         BoundingBox.h</span>
00004 <span class="comment"></span>
00005 <span class="comment"> @Title        </span>
00006 <span class="comment"></span>
00007 <span class="comment"> @Version      </span>
00008 <span class="comment"></span>
00009 <span class="comment"> @Copyright    Copyright (C)  Imagination Technologies Limited.</span>
00010 <span class="comment"></span>
00011 <span class="comment"> @Platform     ANSI compatible</span>
00012 <span class="comment"></span>
00013 <span class="comment"> @Description  Struct to describe a 3D bounding box. Can be generated from POD</span>
00014 <span class="comment">               data.</span>
00015 <span class="comment"></span>
00016 <span class="comment">******************************************************************************/</span>
00017 <span class="preprocessor">#ifndef BOUNDINGBOX_H</span>
00018 <span class="preprocessor"></span><span class="preprocessor">#define BOUNDINGBOX_H</span>
00019 <span class="preprocessor"></span>
00020 <span class="comment">/****************************************************************************</span>
00021 <span class="comment">** Includes</span>
00022 <span class="comment">****************************************************************************/</span>
00023 <span class="preprocessor">#include "PVRTools.h"</span>
00024 
00025 
00026 <span class="keyword">namespace </span>pvrengine
00027 {
00028     <span class="comment">/*!***************************************************************************</span>
00029 <span class="comment">     * @Struct BoundingBox</span>
<a name="l00030"></a><a class="code" href="namespacepvrengine.html">00030</a> <span class="comment">     * @Brief Describes a 3D bounding box</span>
00031 <span class="comment">     * @Description Describes a 3D bounding box</span>
00032 <span class="comment">     *****************************************************************************/</span>
00033     <span class="keyword">struct </span><a class="code" href="structpvrengine_1_1BoundingBox.html">BoundingBox</a>
00034     {
00035     <span class="comment">/****************************************************************************</span>
00036 <span class="comment">    ** Variables</span>
00037 <span class="comment">    ****************************************************************************/</span>
<a name="l00038"></a><a class="code" href="structpvrengine_1_1BoundingBox.html">00038</a>         <span class="comment">// the actual bounding points</span>
00039         PVRTVec3 <a class="code" href="structpvrengine_1_1BoundingBox.html#o0">vPoint</a>[8];
00040 
00041     <span class="comment">/*!***************************************************************************</span>
00042 <span class="comment">    @Function           BoundingBox</span>
00043 <span class="comment">    @Description        Blank constructor.</span>
<a name="l00044"></a><a class="code" href="structpvrengine_1_1BoundingBox.html#o0">00044</a> <span class="comment">    *****************************************************************************/</span>
00045         <a class="code" href="structpvrengine_1_1BoundingBox.html#a0">BoundingBox</a>(){};
00046 
00047     <span class="comment">/*!***************************************************************************</span>
00048 <span class="comment">    @Function           BoundingBox</span>
00049 <span class="comment">    @Input              vCorners    a pointer to an array of 8 corner points</span>
00050 <span class="comment">    @Description        Simple constructor to create BoundingBox directly from</span>
<a name="l00051"></a><a class="code" href="structpvrengine_1_1BoundingBox.html#a0">00051</a> <span class="comment">                        precalculated points.</span>
00052 <span class="comment">    *****************************************************************************/</span>
00053         <a class="code" href="structpvrengine_1_1BoundingBox.html#a0">BoundingBox</a>(<span class="keyword">const</span> PVRTVec3* <span class="keyword">const</span> vCorners)
00054         {
00055             <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;8;++i)
00056             {
00057                 <a class="code" href="structpvrengine_1_1BoundingBox.html#o0">vPoint</a>[i]=vCorners[i];
00058             }
00059         }
<a name="l00060"></a><a class="code" href="structpvrengine_1_1BoundingBox.html#a1">00060</a> 
00061     <span class="comment">/*!***************************************************************************</span>
00062 <span class="comment">    @Function           BoundingBox</span>
00063 <span class="comment">    @Input              other - another bounding box</span>
00064 <span class="comment">    @Description        copy constructor.</span>
00065 <span class="comment">    *****************************************************************************/</span>
00066         <a class="code" href="structpvrengine_1_1BoundingBox.html#a0">BoundingBox</a>(<span class="keyword">const</span> <a class="code" href="structpvrengine_1_1BoundingBox.html">BoundingBox</a>&amp; other)
00067         {
00068             <span class="keywordflow">for</span>(<span class="keywordtype">int</span> i=0;i&lt;8;++i)
00069             {
00070                 <a class="code" href="structpvrengine_1_1BoundingBox.html#o0">vPoint</a>[i]=other.<a class="code" href="structpvrengine_1_1BoundingBox.html#o0">vPoint</a>[i];
00071             }
00072         }
00073 
<a name="l00074"></a><a class="code" href="structpvrengine_1_1BoundingBox.html#a2">00074</a> 
00075     <span class="comment">/*!***************************************************************************</span>
00076 <span class="comment">    @Function           BoundingBox</span>
00077 <span class="comment">    @Input              pV array of vertices</span>
00078 <span class="comment">    @Input              i32NumberOfVertices size of array pV</span>
00079 <span class="comment">    @Description        Constructor that calculates the eight vertices that</span>
00080 <span class="comment">                        surround an object.</span>
00081 <span class="comment">                        This function should only be called once to determine the</span>
00082 <span class="comment">                        object's bounding box.</span>
00083 <span class="comment">    *****************************************************************************/</span>
00084     <a class="code" href="structpvrengine_1_1BoundingBox.html#a0">BoundingBox</a>(<span class="keyword">const</span> PVRTVec3* <span class="keyword">const</span> pV,
00085                         <span class="keyword">const</span> <span class="keywordtype">int</span> i32NumberOfVertices);
00086 
00087     <span class="comment">/*!***************************************************************************</span>
00088 <span class="comment">    @Function           BoundingBox</span>
00089 <span class="comment">    @Input              pV array of vertices</span>
00090 <span class="comment">    @Input              i32NumberOfVertices size of array pV</span>
00091 <span class="comment">    @Input              i32Offset the offset of the array</span>
00092 <span class="comment">    @Input              i32Stride the stride of the array</span>
00093 <span class="comment">    @Description        Calculate the eight vertices that surround an object.</span>
00094 <span class="comment">                        This function should only be called once to determine the</span>
00095 <span class="comment">                        object's bounding box.</span>
00096 <span class="comment">                        Takes interleaved data using the first vertex's offset</span>
00097 <span class="comment">                        and the stride to the next vertex thereafter</span>
00098 <span class="comment">    *****************************************************************************/</span>
00099     <a class="code" href="structpvrengine_1_1BoundingBox.html#a0">BoundingBox</a>(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> pV,
00100         <span class="keyword">const</span> <span class="keywordtype">int</span>           i32NumberOfVertices,
00101         <span class="keyword">const</span> <span class="keywordtype">int</span>           i32Offset,
00102         <span class="keyword">const</span> <span class="keywordtype">int</span>           i32Stride);
00103 
00104     };
00105 }
00106 
00107 <span class="preprocessor">#endif // BOUNDINGBOX_H</span>
00108 <span class="preprocessor"></span>
00109 <span class="comment">/*****************************************************************************</span>
00110 <span class="comment"> End of file (BoundingBox.h)</span>
00111 <span class="comment">*****************************************************************************/</span>
00112 
</pre></div><br>
<br>
<P align=left><FONT size=2><STRONG><A 
   href="http://www.imgtec.com/powervr/insider/legal/index.asp">Copyright</A> � 
   1999-2008, Imagination Technologies Ltd.</STRONG></FONT></P>
<hr>
<address style="align: left;"><small><FONT color=f0f>
Generated by <a href="http://www.doxygen.org/index.html">DOXYGEN</a> 1.3.6</small></address>
</body>
</html>
